//
//  IMPeopleTopView.m
//  markmap
//
//  Created by 甘世清 on 2024/5/30.
//

#import "IMPeopleTopView.h"

@implementation IMPeopleTopView

- (void)SQ_UIViewForSelfView{
    self.backgroundColor = UIColor.whiteColor;
    [self addSubview:self.avatarImageView];
    [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(60);
        make.left.equalTo(self).offset(12);
        make.centerY.equalTo(self).offset(-4);
    }];
    
    [self addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.avatarImageView.mas_right).offset(10);
        make.centerY.equalTo(self).offset(-4);
    }];
    UIView * lineView = [[UIView alloc]init];
    lineView.backgroundColor = SQColor(@"#363636");
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.right.equalTo(self);
        make.height.mas_equalTo(4);
    }];
}

- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = UIColor.blackColor;
        _nameLabel.font = FONT_BOLD(18);
    }
    return _nameLabel;
}

- (HeaderView *)avatarImageView{
    if (!_avatarImageView) {
        _avatarImageView = [[HeaderView alloc]init];
        _avatarImageView.clipsToBounds = YES;
        _avatarImageView.layer.cornerRadius = 30;
        _avatarImageView.layer.masksToBounds = YES;
       
        _avatarImageView.headerImage.contentMode = UIViewContentModeScaleAspectFill;
    }
    return _avatarImageView;
}

@end
